package com.tanhua.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanhua.common.pojo.Test;
import com.tanhua.common.pojo.TestQuestion;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface TestMapper extends BaseMapper<Test> {
    @Select("SELECT t3.id,t3.question FROM(SELECT t1.qid FROM test_question t1 WHERE t1.id=#{id})t2,tb_options t3 where t2.qid=t3.id")
    public List<TestQuestion> queryQuestionsById(String id);


    @Select("SELECT `options` FROM `tb_options` where id=#{questionId}")
    public String queryOptionByQuestionId(String questionId);
}
